package com.ayoka.parenting.adapter;

import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.view.ViewGroup;

import com.ayoka.parenting.R;
import com.ayoka.parenting.bean.GrownPathBean;
import com.ayoka.parenting.bean.ProfitRecordBean;
import com.jincp.common.brvah.BaseQuickAdapter;
import com.jincp.common.brvah.BaseViewHolder;
import com.jincp.common.utils.StringUtil;


/**
 * @ProjectName: ayoka7.
 * @ClassName: CourseClassroomMemberAdapter.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/8/6 21:15.
 */

public class ProfitRecordAdapter extends BaseQuickAdapter<ProfitRecordBean, BaseViewHolder> {

    public ProfitRecordAdapter() {
        super(R.layout.item_profit_record);
    }

    @Override
    protected void convert(BaseViewHolder holder, ProfitRecordBean item) {
        if (item.FromUser != null) {
            holder.setText(R.id.tv_buyer_name, StringUtil.formatString(R.string.format_buyer_name, item.FromUser.WeixinNickName));
        }
        holder.setText(R.id.tv_profit_amount, StringUtil.formatString("%.2f", item.Commission))
                .setText(R.id.tv_profit_amount, item.CreateDate);
    }
}
